<template>
  <div class="image-wrapper" @click="onImgClick">
   <img :class="[round ? 'active': '' ]" :src="src" />
  </div>
</template>

<script>
export default {
  props: {
    src: {
      type: String,
      default: require('@/assets/imgs/timg.jpeg')
    },
    alt: {
      type: String,
      default: '默认提示'
    },
    round: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
    }
  },
  methods: {
    onImgClick() {
      this.$emit('onImgClick')
    }
  }
}
</script>

<style lang="scss" scoped>
.image-wrapper {
  width: 100%;
  height: 100%;
  img {
    width: 100%;
    height: 100%;
  }
  .active {
    border-radius: 50%;
  }
}
</style>
